<?xml version="1.0" encoding="utf-8"?>
<!-- DispatcherServlet Context: defines this servlet's request-processing
        infrastructure -->
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	   http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
    <context:property-placeholder location="classpath:application.yml"/>


    <!--    <bean name="dataSource"-->
    <!--          class="org.springframework.jdbc.datasource.DriverManagerDataSource">-->
    <bean name="dataSource" class="com.zaxxer.hikari.HikariDataSource">
        <property name="driverClassName" value="${r'${jdbc.driverClassName}'}"/>
        <property name="jdbcUrl" value="${r'${jdbc.jdbcUrl}'}"/>
        <property name="username" value="${r'${jdbc.username}'}"/>
        <property name="password" value="${r'${jdbc.password}'}"/>
    </bean>
    <!-- 测试环境数据库2 -->

    <!-- 配置数据源,加载配置,也就是dataSource -->
    <bean name="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"></property>
        <!--mybatis的配置文件-->
        <!--扫描 XXXmapper.xml映射文件,配置扫描的路径-->
        <!-- <property name="mapperLocations" value="classpath:com/javafeng/mapping/*.xml"></property>
        <property name="mapperLocations" value="classpath:com/inspur/NSRZCXXGR/mapping/*.xml"></property> -->
        <property name="mapperLocations">
            <array>
                <value>classpath*:mapper/${projectDefinitionDO.serverProjectDefinitionDO.serverProjectClassName}/Mapper*.xml</value>
            </array>
        </property>
    </bean>

    <!-- DAO接口所在包名，Spring会自动查找之中的类 -->
    <bean name="configurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="${projectDefinitionDO.serverProjectDefinitionDO.dapPackagePathName}"/>
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
    </bean>

</beans>